import java.util.Scanner;

public class Solution {
    public static int n, m;
    public static boolean[] choose = new boolean[11];  //标记路径中选择了谁
    public static int sum;  //标记路径中选择的元素的和

    public static void dfs(int x){
        if(sum == m){
            for(int i = 1; i <= n; i++){
                if(choose[i]){
                    System.out.print(i + " ");
                }
            }
            System.out.println("");
            return ;
        }

        if(sum > m || x > n) { return ;}

        //选 x
        sum += x;
        choose[x] = true;
        dfs(x + 1);
        sum -= x;
        choose[x] = false;

        //不选 x
        dfs(x + 1);
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt(); m = in.nextInt();

        dfs(1);
    }
}
